package com.yueyi.yygh.task.scheduled;

import com.yueyi.common.rabbit.constant.MqConst;
import com.yueyi.common.rabbit.service.RabbitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author zyy
 * @create 2022-02-22 13:54
 */
@Component
//开启定时任务
@EnableScheduling
public class ScheduledTask {

    @Autowired
    private RabbitService rabbitService;
    //每天8点执行方法，就医提醒
    //@Scheduled(cron = "0 0 1 * * ?")
    @Scheduled(cron = "0/30 * * * * ?")
    public void taskPatient(){
        rabbitService.sendMessage(MqConst.EXCHANGE_DIRECT_TASK,MqConst.ROUTING_TASK_8,"");
    }
}
